#!/bin/bash

# A simple script to "install" maxe by linking back to its bits and pieces
# convenient for testing during development, but passable as an installer
# until something better can be written.

# "phase" is implied by the script name (_phase)
ln -sf $PWD/bin/maxe.rb /usr/local/sbin/maxe_setup
ln -sf $PWD/bin/maxe.rb /usr/local/sbin/maxe_install
ln -sf $PWD/bin/maxe.rb /usr/local/sbin/maxe_config
ln -sf $PWD/bin/maxe.rb /usr/local/sbin/maxe_restart

ln -sf $PWD/doc/man8 /usr/local/share/man/man8/maxe_setup.8
ln -sf $PWD/doc/man8 /usr/local/share/man/man8/maxe_install.8
ln -sf $PWD/doc/man8 /usr/local/share/man/man8/maxe_config.8
ln -sf $PWD/doc/man8 /usr/local/share/man/man8/maxe_restart.8

echo "install_dir = $PWD" > /etc/maxe.conf
echo "machines_data = $PWD/conf/machines.yaml" >> /etc/maxe.conf
echo "scripts_dir = $PWD/scripts/centos5-hosting" >> /etc/maxe.conf
